{% extends 'IcsocUIBundle::page.html.twig' %}
{% from 'IcsocUIBundle:Macro:grid.html.twig' import gridWidth,gridNav,gridConfig,sendKeyWord,gridKeyword %}
{% block stylesheet %}
    {{ parent() }}
    {% stylesheets
    '@jqgird_css'
    '@gritter_css'
    filter='cssrewrite' filter='uglifycss'
    %}
    <link rel="stylesheet" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}

{% block content %}
    <h3 class="header smaller lighter green">告警配置:</h3>
    {{ gridKeyword('关键字') }}
    <table id="grid-table"></table>
    <div id="grid-pager"></div>
{% endblock %}
{% block footer %}
    {% javascripts
    '@jqgird_js'
    '@gritter_js'
    '@common_js'
    filter='uglifyjs'
    %}
    <script src="{{ asset_url }}"></script>
    {% endjavascripts %}
    <script type="text/javascript">
        jQuery(function($) {
            {{ gridWidth() }}
            jQuery(grid_selector).jqGrid({
                url: "{{ path('icsoc_monitor_alarm_list_data') }}",  //数据；
                mtype: 'POST',
                datatype: "json", //从服务器端返回的数据类型，默认xml：xml，local，json，jsonnp，script，xmlstring，jsonstring，clientside
                height: '100%', //展示高度；
                colNames:['{{ 'actions'|trans }}','id', '告警任务','告警技能组',
                    /*'触发条件',*/'告警频率','告警方式'/*, '告警通知'*/],  //列显示名称，是一个数组对象
                colModel:[
                    {name:'myac',index:'', width:80, fixed:true, sortable:false, resize:false,
                        formatter:'actions',
                        formatoptions:{
                            keys:true,
                            editbutton:true,
                            editformbutton: true,
                            delOptions:{recreateForm: true, beforeShowForm:beforeDeleteCallback, afterSubmit:afterDeleteCallback,left:540,top:206},
                            editOptions:{width: "0",height: "0", jqModal:false, beforeShowForm:beforeEditCallback }
                        }
                    },
                    {name:'id',index:'id', width:40,hidden:true,editable: true, sortable:true},
                    {name:'alarm_name',index:'alarm_name', width:250,editable:true, sortable:false},
                    {name:'que_config',index:'que_config',width:300,editable:true, sortable:false},
                    //{name:'term',index:'term', editable:true,width:90, sortable:false, nowrap:false },
                    {name:'alarm_time',index:'alarm_time', width:300,editable:true, sortable:false},
                    {name:'alarm_type',index:'alarm_type',width:300,editable:true, sortable:false}
                    //{name:'alarm_value',index:'alarm_value',width:90,editable:true, sortable:false}
                ],
                {{ gridConfig() }}
                editurl: "{{ path('icsoc_monitor_alarm_del') }}",
                caption: "告警配置列表", //表格名称
                sortname: 'id',
                sortorder: 'asc'
        });
            {{ gridNav(false,false,true,false,true,true,path('icsoc_monitor_alarm_html'),path('icsoc_monitor_alarm_html')) }}
        });
        {{ sendKeyWord() }}
    </script>
{% endblock %}